package action.general;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.*;

import service.securite.Erreur;


public class AccueilServlet extends Action {
	   static final long serialVersionUID = 1L;

	    /* (non-Java-doc)
		 * @see javax.servlet.http.HttpServlet#HttpServlet()
		 */
	
		
		public static boolean aLesDroits(HttpServletRequest request) {
			return true;
		}
		
		public ActionForward execute(final ActionMapping pMapping,
				ActionForm pForm, final HttpServletRequest pRequete,
				final HttpServletResponse pReponse) {
				//this.execute(pMapping,pForm,pRequete,pReponse);
			
			if (!AccueilServlet.aLesDroits(pRequete)) {
				//Erreur.setErreurDroits(pRequete, pReponse, getServletContext());
				return pMapping.findForward("error");
			}
			
			try {
				//ServletContext context = getServletContext();
				
				//pReponse.sendRedirect("/index.jsp");
				//RequestDispatcher rd = context.getRequestDispatcher();
				//rd.forward(pRequete, pReponse);
			} catch (Exception e) {
				e.printStackTrace();
			}
			return pMapping.findForward("success");
		}
				
}